package com.hellobike.haxing.modules.shop.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.hellobike.haxing.common.vo.Result;
import com.hellobike.haxing.modules.product.entity.City;
import com.hellobike.haxing.modules.product.entity.District;
import com.hellobike.haxing.modules.product.entity.Province;
import com.hellobike.haxing.modules.product.entity.Street;
import com.hellobike.haxing.modules.shop.entity.Shop;
import org.springframework.web.multipart.MultipartFile;

import java.io.IOException;
import java.math.BigDecimal;
import java.util.List;

/**
 * @Description: 自提点
 * @Author: haxing-boot
 * @Date: 2020-02-03
 * @Version: V1.0
 */
public interface IShopService extends IService<Shop> {

    List<Province> getOpenedProvinces();

    List<City> getOpenedCitiesByProvinceId(Long provinceId);

    List<City> getOpenedCitiesByProvinceIds(List<Long> provinceIdList);

    List<City> getAllOpenedCities();

    List<District> getOpenedDistrictsByCityId(Long cityId);

    List<District> getOpenedDistrictsByCityIds(List<Long> cityIdList);

    List<Street> getOpenedStreetsByDistrictId(Long districtId);

    List<Street> getOpenedStreetsByDistrictIds(List<Long> districtIdList);

    List<Shop> getShopsByStreetId(Long streetId);

    List<Shop> getShopsByStreetIds(List<Long> streetIdList);

    /**
     * 更新收入
     *
     * @param amount
     * @param shopId
     * @return
     */
    void updateIncome(BigDecimal amount, Long shopId);

    /**
     * 开启店铺
     *
     * @param id
     * @param username
     */

    Result<String> openShop(Long id, String username);


    /**
     * 关闭店铺
     *
     * @param id
     * @param username
     * @return
     */
    Result<?> closeShop(Long id, String username);

    Result<?> audit(Long id, String username, Integer state, String reason, Long leadShopId, String bankCode);

    Result<?> saveExtension(Shop shop);

    Result<?> importShop(MultipartFile file) throws IOException;
}
